const express = require('express');
const router = express.Router();
const verifySignature = require('../middleware/signature');
const xmlParser = require('../middleware/xmlParser');
const { validateWechatServer } = require('../controllers/authController');
const { handleMessage } = require('../controllers/messageController');

// 微信验证接口
router.get('/', verifySignature, validateWechatServer);

// 微信消息接收接口
router.post('/', verifySignature, xmlParser, handleMessage);

module.exports = router;